Skip to main content

copp\copp\copp2\opt2/
mod.rs

1//! Optimization backends for second-order path parameterization (Clarabel-based).
2//!
3//! # Method identity
4//! This module provides optimization formulations for:
5//! - **Time-Optimal Path Parameterization (TOPP2)**,
6//! - **Convex-Objective Path Parameterization (COPP2)**.
7//!
8//! # Contents
9//! - `clarabel_constraints`: shared standard TOPP2 constraint assembly.
10//! - [`copp2_socp`](crate::solver::copp2_socp::copp2_socp): COPP2 backend via **Second-Order Cone Programming (SOCP)**
11//!   with normal/expert/core layering.
12
13use clarabel::solver::{DefaultSolution, LinearSolverInfo};
14
15pub(crate) mod clarabel_constraints;
16pub(crate) mod copp2_socp;
17
18/// Clarabel expert result for second-order optimization backends.
19///
20/// This extends the public expert tuple `(Option<Vec<f64>>, DefaultSolution<f64>)`
21/// with solver-side metadata that Clarabel stores outside [`DefaultSolution`](clarabel::solver::DefaultSolution).
22/// The high-level `result` field is `Some(a)` only when the solver status is
23/// accepted by the provided [`ClarabelOptions`](crate::solver::copp2_socp::ClarabelOptions).
24pub struct ClarabelExpertInfor2nd {
25    /// Accepted second-order profile `a = ds/dt ^ 2`, or `None` when the solver
26    /// status is not accepted.
27    pub result: Option<Vec<f64>>,
28    /// Raw Clarabel solution, including primal/dual/slack vectors and status.
29    pub solution: DefaultSolution<f64>,
30    /// Clarabel linear-solver metadata captured before the solver object is
31    /// consumed.
32    pub linsolver: LinearSolverInfo,
33}